<?php
/**
	Formul�rio para cadastro de uma natureza.
*/

if(!isset($_SESSION))
{
   session_start();
}

if( !function_exists('__autoload') )
{
    function __autoload($class_name) {
    require_once $class_name . '.php';
    }
}

SAEO::ValidarAcesso( array( 0, 2 ) )

?>
<html>
	<head>
		<title>SAEO - Cadastro de Natureza de despesa</title>
		<link rel='stylesheet' type='text/css' href='templates/estilos.css'>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script type='text/javascript' src='templates/programa.js'></script>
        <script type='text/javascript' src='templates/hintbox.js'></script>
        <script type='text/javascript' src='templates/js.js'></script>
        <script type='text/javascript' src='templates/ajax.js'></script>
        <script type='text/javascript' src='templates/validacoes.js'></script>
	</head>
	<body class='body' onload="document.cadastrar_subElemento.codNatureza.focus();">
		<form name='cadastrar_subElemento' action='EnviarDadosSubElemento.php?operacao=1' method='post' onsubmit=''>
		<table width='779' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFFF'>
			<tr>
				<td colspan='2'><?php //include "Topo.php"; ?></td>
			</tr>
			<tr>
				<td>
					<div class='titulosTabelas' style='width:779; height:20; background:url(templates/tabela.jpg)'>CADASTRO DE NATUREZA DA DESPEZA</div>
				</td>
            </tr>
            <tr>
                <td colspan='2'>&nbsp;</td>
            </tr>
            <tr>
                <td>
                	<table class='tabela' width='650' border='0' cellspacing='0' cellpadding='0' align='center' bgcolor='#FFFFFF'>
						<tr>
							<td>&nbsp;</td>
						</tr>
						<tr>
 							<td class="textoTabelas">&nbsp;Natureza de despesa:</td>
 							<td>
    						<select name='naturezaDespesa' id="naturezaDespesa" class='inputTexto' style="width: 310px;" >                             
                               			<option value="0" >Selecione uma Natureza de Despesa</option>
										<?php
                               			$naturezaDespesa = new NaturezaDespesa();
                               			$naturezaDespesas = $naturezaDespesa->CarregarNaturezaDespesas(); 
			                            //Percorre o array anosCadastrados e cria options para cada posi��o.
			                            for ($i = 0; $i < count( $naturezaDespesas ); $i++){			                            	
			                            	echo "<option value='".$naturezaDespesas[$i]->id."'>".$naturezaDespesas[$i]->id." - ".$naturezaDespesas[$i]->descricao."</option>";
			                            }
										?>
                               </select>
                               <a href='#' class='hintanchor' onMouseover='showhint("Natureza da Despesa.", this, event, "220px");'>[?]</a>		                               
                            </td>   
						</tr>						
						<tr>
							<td colspan='2'>&nbsp;</td>
						</tr>
						<tr>
							<td class='textoTabelas'>&nbsp;C&oacute;digo:</td>
							<td>
								<input type='text' name='codSub' id="codSub" size='15' maxlength='2' class='inputNumeros' onKeyPress='return formataCampos(this,"??", event);'>
								<a href='#' class='hintanchor' onMouseover='showhint("C&oacute;digo do SubElmento de despesa formato xx apenas os dois ultimos digitos.", this, event, "220px");'>[?]</a>
							</td>
						</tr>
						<tr>
							<td colspan='2'>&nbsp;</td>
						</tr>						
						<tr>
							<td class='textoTabelas'>&nbsp;Descri&ccedil;&atilde;o</td>
							<td>
								<input type='text' name='descSub' size='49' maxlength='200' class='inputTexto'>
								<a href='#' class='hintanchor' onMouseover='showhint("Descrição da natureza.", this, event, "220px");'>[?]</a>
							</td>
						</tr>						
						<tr>
							<td colspan='2'>&nbsp;</td>
						</tr>
						<tr>
							<td colspan='2' height='46'>
								<div style='position:relative;left:540px'>
									<input type='image' style='width:100px;height:30px;' onclick='EnviarInformacoes();' src='templates/btavancar.JPG'/>
								</div>
							</td>
						</tr>
                     </table>
                </td>
			</tr>
            <tr>
                <td>&nbsp;</td>
            </tr>
            <tfoot>
	           	<tr>
					<td colspan='2'>&nbsp;</td>
	            </tr>
				<tr>
                   	<?php include 'rodapeCreditos.php'; ?>
                   </tr>
            </tfoot>
		</table>
     	</form>
	</body>
</html>